(define tower '(integer rational real complex))

(define (higher? type1 type2)
  (if (< (length (memq type1 tower))
         (length (memq type2 tower)))
      #t
      #f))

(define (get-top types)
  (define (iter top rest-types)
    (if (null? rest-types)
      top
      (if (higher? top (car rest-types))
          (iter top (cdr rest-types))
          (iter (car rest-types) (cdr rest-types)))))
  (iter 'integer types))

(define (multi-raise type arg)
  (if (eq? type (type-tag arg))
      arg
      (multi-raise type (raise arg)))) 